set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

# cross compiler
# set(CMAKE_C_COMPILER   arm-none-linux-gnueabi-gcc)
# set(CMAKE_CXX_COMPILER arm-none-linux-gnueabi-g++)
set(CMAKE_CXX_COMPILER_TARGET arm-ostl-linux-gnueabi)
set(CMAKE_C_COMPILER_TARGET arm-ostl-linux-gnueabi)

# set(CMAKE_MAKE_PROGRAM /usr/bin/make)
# sysroot
set(CMAKE_SYSROOT /opt/st/stm32mp1/3.1-openstlinux-5.4-dunfell-mp1-20-06-24/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT};/home/byons/Qt/6.9.1/stm32mp1_ext)

set(QT_QMAKE_EXECUTABLE /home/byons/Qt/6.9.1/stm32mp1_ext/bin/qmake)

# 设置GLES2_INCLUDE_PATH和GLES2_LIBRARY
set(GLES2_INCLUDE_PATH ${CMAKE_SYSROOT}/usr/include/GLES2)
set(GLES2_LIBRARY ${CMAKE_SYSROOT}/usr/lib/libGLESv2.so)

# tell CMake to search in sysroot first
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

add_compile_definitions(OS_STM32MP1)
